@extends('app')

@section('content')
<div class="container">
	<div class="row">
		<div class="col-md-12">
			<div class="panel panel-primary">
				<div class="panel-heading">新闻后台
                    <a href="/news/create" class="col-md-offset-10 btn btn-primary ">新建</a>
                </div>
				<div class="panel-body">
                    <div class="main">
                        @foreach($news as $new)
                        <ul class="thumbnails">
                            <li class="span4">
                            <div class="thumbnail">
                                <img alt="300x200" src="{{url("image/".$new->imageName)}}" />
                                <div class="caption">
                                    <h3>
                                        {{$new->title}}
                                    </h3>
                                    <p>
                                        {{$new->abstract}}
                                    </p>
                                    <p>
                                        <a href="/news/{{$new->id}}" class="btn btn-primary" >浏览</a>
                                        <button type="button" class="btn btn-danger " data-toggle="modal" data-target="#myModal">删除</button>
                                        <a class="btn" href="#">分享</a>
                                        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
                                            <div class="modal-dialog ">
                                                <div class="modal-content">
                                                    <div class="modal-header">
                                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
                                                        <h4 class="modal-title" id="myModalLabel">删除</h4>
                                                    </div>
                                                    <div class="modal-body">
                                                        您确定删除此新闻
                                                    </div>
                                                    <div class="modal-footer">
                                                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                                        <a href="/news/{{$new->id}}/delete" class="btn btn-danger"  >删除</a>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </p>
                                </div>
                            </div>
                            </li>
                        </ul>
                        @endforeach
                    </div>
				</div>
			</div>
		</div>
	</div>
</div>
@endsection
